1. Field of the Invention
The present invention relates to an image processing device for detecting red eye (red-eye phenomenon) occurring in image data picked up e.g. by an image pickup apparatus, or a face in the image data, an image processing method, a program for implementing the image processing method, and a storage medium storing the program.
2. Description of the Related Art
In general, an image pickup apparatus, such as a digital camera or a digital video camera, performs predetermined image processing on an imaging signal obtained by an image pickup operation, and records the signal subjected to the image processing, as image data, in a removable memory card. The image data is recorded as an Exif (Exchangeable Image File Format) file in the memory card. The Exif, particularly the Exif 2.2 specifies information to be recorded, in a detailed manner, so as to easily achieve improvement of print image quality. For example, the Exif 2.2 file is comprised of a start code, a header section, a data section, and a stop code, as shown in FIG. 16. The header section of the Exif 2.2 file contains Exif tags and a thumbnail image. In the respective Exif tags, there are recorded shooting information items concerning the presence/absence of a flash, a shooting mode (portrait/landscape/fidelity), and so forth. The data section stores image data.
Examples of a printing apparatus for printing out image data picked up by the image pickup apparatus include a digital photo printer and a direct printer.
A digital photo printer is configured to print image data picked up by an image pickup apparatus, or to optically scan a silver salt film and print out image data obtained by the scanning.
For example, in the case of printing image data picked up by an image pickup apparatus, a digital photo printer refers to shooting information in the Exif tags recorded together with the image data, and performs optimal printing according to the shooting information. For example, when image data is picked up by the image pickup apparatus with the exposure mode thereof set to auto, the image data can be underexposed or overexposed for some reason against a photographer's intention. In such a case, the digital photo printer recognizes, based on shooting information of the Exif tags, that the exposure mode is set to auto, and performs density correction on the image data such that the underexposed or overexposed portion of the image data can be printed out as an optimally exposed image. On the other hand, when image data is picked up by the image pickup apparatus with the exposure mode thereof intentionally set to manual by the photographer, the digital photo printer recognizes, based on shooting information of the Exif tags, that the exposure mode is set to manual, and does not perform excessive density correction on the image data.
Further, when halation occurs in image data due to automatic light emission from a strobe, the digital photo printer recognizes, based on shooting information of the Exif tags, that automatic light emission from the strobe may have caused the halation in the image data. Then, the digital photo printer corrects the image data such that a proper image density is obtained by carrying out processing e.g. for reducing the brightness of the colors of bright portions (halation portions) of the image data.
As described above, in a digital photo printer, shooting information recorded as Exif tags is used as conditions for optimizing image processing to be performed on image data. More specifically, a digital photo printer prints out an image as desired by a photographer, through recognition of a shooting mode, an exposure mode, and whether the image was taken with or without a flash, based on the shooting information of the Exif tags. However, to be compatible with the Exif 2.2, a digital photo printer is required to have a high image processing capability. To achieve this high image processing capability, a digital photo printer incorporates an image processing device (image processor) with a high processing speed and a large processing capacity, such as a PC (personal computer), a CPU (MPU), or a plurality of CPUs (MPUs).
In shooting a portrait or the like, a red-eye phenomenon that the eyes (pupils) of a person are photographed in red can occur. Occurrence of the red-eye phenomenon causes considerable degradation of image quality. To solve this problem, there have been proposed digital photo printers each capable of performing a red-eye correction process so as to correct red eye. In one method of red-eye correction, for example, a person's face is detected from an image by detection processing, such as edge detection or hue detection (face detection), and then whether pupils are red is detected from the detected face (red-eye detection). When red-eye pupils are detected, the pupils (image data thereof) are subjected to color conversion and the like, whereby correction of the red-eye pupils (red-eye correction) is performed. Further, a face area detected by the face detection is also corrected such that the brightness of the area is optimized. However, execution of the face detection and the red-eye detection in the digital photo printer applies a large load to the digital photo printer, which sometimes makes it difficult to perform red-eye correction along with density correction, or prolongs processing time.
A direct printer is directly connected to the image pickup apparatus without using a personal computer, or has mounted therein a memory card removed from the image pickup apparatus, and captures image data directly from the image pickup apparatus or the memory card to print out the same. Execution of red-eye correction requires high processing capability, and hence there has been proposed no direct printer which is capable of performing the red-eye correction.
On the other hand, an image pickup apparatus has come along that is capable of performing face detection, red-eye detection, and red-eye correction. If face detection, red-eye detection, and red-eye correction are performed by the image pickup apparatus, it is possible to eliminate the need for causing a digital photo printer to carry out the same processing, to thereby reduce load applied to the digital photo printer. Further, if the image pickup apparatus is capable of performing red-eye correction, it is not necessary to equip a direct printer with the function of performing red-eye correction.
However, not all image pickup apparatuses are necessarily equipped with the function of performing red-eye correction. Further, an image pickup apparatus does not always perform red-eye correction on all pieces of image data in which red eye occurs. To cope with this problem, it can be envisaged to perform both red-eye correction and density correction on all pieces of image data e.g. in a digital photo printer. However, this can cause an extra increase in processing time for red-eye correction as described above, and hence there is a fear that productivity may be reduced.
In view of this, there has been proposed a printer which is capable of performing red-eye correction efficiently without causing degradation of productivity (see Japanese Patent Laid-Open Publication No. 2004-145287). Specifically, this printer determines a possibility of occurrence of red eye, using shooting information stored in Exif tags attached to image data by an image pickup apparatus, and performs red-eye correction only on an image having a possibility of occurrence of red eye. The shooting information recorded as the Exif tags concerns a shooting mode and the like. For example, when strobe shooting is recorded as shooting information on an image, it is determined that red eye may have occurred in the image, and red-eye correction is performed on the image data.
As described above, red-eye correction can be performed by an image processing device of an image pickup apparatus, a printer or the like, and hence there are a plurality of chances of performing red-eye correction for a single image. Therefore, if each of the apparatuses performs red-eye correction on all images, there can be cases where a single image is subjected to the same red-eye correction a plurality of times.